_heloname = _this select 0;
_callsign = _this select 1;
_class = _this select 2;
_spwn = _this select 3;

_mkrname = _heloname + "station";
_asloc = createMarker [_mkrname, [0,0,0]];
_asloc setMarkerShape "ELLIPSE";
_mkrname setMarkerBrush "BORDER";
_mkrname setMarkerSize [100,100];
_mkrname setMarkerColor "ColorGreen";
_mkrname2 = _heloname + "station2";
_asloc2 = createMarker [_mkrname2, [0,0,0]];
_asloc2 setMarkerShape "ICON";
_mkrname2 setMarkerSize [1,1];
_mkrname2 setMarkerType "Dot";
_mkrname2 setMarkerColor "ColorGreen";
_mkrname2 setMarkerText _callsign;
_stgtar = format ["'%1' setMarkerPos _pos,'%2' setMarkerPos _pos,ASclick = true",_mkrname,_mkrname2];
openMap [true,true];
onMapSingleClick _stgtar;
titleText ["Select a Station Point", "PLAIN DOWN"];
waitUntil {ASclick};
onMapSingleClick "";
titleFadeOut 0;
sleep 1;
openMap [false,false];
ASclick = false;

_spwndir = getdir _spwn;
_helo = createVehicle [_class, getPos _spwn, [], 0, "FLY"];
removeAllweapons _helo;
_helo setVehicleVarName _heloname;
_helo setpos [(getpos _spwn select 0),(getpos _spwn select 1),(getpos _spwn select 2)+RUM_AHEL_flyHeight];
_helo setdir _spwndir;
_helo setVariable ["RUM_inFlight", true, true];

_grp = createGroup WEST;
_pilot = _grp createUnit [RUM_AHEL_Pilot, getpos _spwn, [], 0, "FORM"];
_pilot moveinDriver _helo;
_gunner = _grp createUnit [RUM_AHEL_Pilot, getpos _spwn, [], 0, "FORM"];
_gunner moveinGunner _helo;
if!(_gunner in crew _helo)then{deleteVehicle _gunner};

["sendtostation",[player,_pilot,_callsign]] execVM (RUM_PATH+"AHel\radiodialogs.sqf");
//sleep 20;

fwp2=_grp addWaypoint [getmarkerpos _mkrname2, 0];
fwp2 setWaypointType "MOVE";
fwp2 setWaypointSpeed "NORMAL";
fwp2 setWaypointBehaviour "CARELESS";
fwp2 setWaypointCombatMode "BLUE";
fwp2 setWaypointCompletionRadius 50;
_helo flyInheight RUM_AHEL_flyHeight;
sleep 15;

_helo doMove [ (getPos _helo select 0), (getPos _helo select 1), RUM_AHEL_flyStationHeight];
_helo flyInheight RUM_AHEL_flyStationHeight;
waituntil{((getPos _helo select 2) <= (RUM_AHEL_flyStationHeight + 5))};

//hint format ["%1",_arry1];

//waitUntil{(!alive _helo) or (moveToCompleted _pilot)};

_arry = _this + [_helo];

["flightcheckin",[player,_pilot,_callsign]] execVM (RUM_PATH+"AHel\radiodialogs.sqf");

RUM_AHelAircraft_onStation = RUM_AHelAircraft_onStation + [_arry];
publicVariable "RUM_AHelAircraft_onStation";
//hint format ["%1",RUM_FXDAircraft_onStation];

if(true)exitwith{};
